/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/4/7
 * Time: 18:45
 * Description: No Description
 */
class Animal {

     void eat() {
        System.out.println("这是一个父类方法");
    }
}
class Cat extends Animal{
    public String name = "wen";
    public int age = 20;
    public static String hair= "蓝色";

    {
        this.name= "wenxiwen";
        this.age = 10;
        System.out.println("这是一个实例代码块");
    }

    static {
        hair = "蓝色";
        System.out.println("这是一个静态代码块");
    }

     void eat() {
        System.out.println("这是一个实例成员变量");
    }
}

public class TestDemo {
    public static void main(String[] args) {
        new Cat();
    }
}